/*
 * 百度在线网络技术（北京）有限公司拥有本软件版权2021并保留所有权利。
 * Copyright 2021, Baidu.com,Inc 2:Baidu Online Network Technology (Beijing) Co.,Ltd,
 * All rights reserved.
 */

package com.azdebugit.spring.beantest.cnblog.spring.valu;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.context.annotation.Scope;

/**
 * 配置类，使用@Value注解进行属性注入
 * 引入配置文件
 */
@Configuration
@PropertySource(value = {"classpath:/config.properties"})
public class BeanConfig {

    //使用无参构造器注册Bottle
    @Bean(value = "bottle")
    @Scope("singleton")
    public Bottle bottle() {
        return new Bottle();
    }
}